package com.bitcola.security.activity.controller;


import com.bitcola.security.activity.biz.CharityBiz;
import com.bitcola.security.auth.client.annotation.IgnoreUserToken;
import com.bitcola.security.common.context.BaseContextHandler;
import com.bitcola.security.common.msg.AppResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("charity")
public class CharityController {

    @Autowired
    CharityBiz charityBiz;



    @RequestMapping(value = "queryStage")
    @IgnoreUserToken
    public AppResponse  queryStage()
    {

        return AppResponse.ok().data(charityBiz.getCurrent());
    }


    @RequestMapping(value = "queryRows")
    @IgnoreUserToken
    public AppResponse  queryRows(String userId,int num)
    {
        return AppResponse.ok().data(charityBiz.getRow(userId,num));
    }

    @RequestMapping(value = "support")

    public AppResponse  support(String rowId){
        return AppResponse.ok().data(charityBiz.support(BaseContextHandler.getUserID(),rowId));
    }


}
